#include <stdio.h>
#include <unistd.h>
int main(int argc,char* argv[])
{
	if(argc < 2)
	{
		printf("incorrect parameter\n");
		return 1;
	}
	if(access(argv[1],F_OK) == -1)
	{
		printf("%s does not exist\n",argv[1]);
		return 1;
	}
	const int buffer_size = 1024;
	char buffer[1024] = {'\0'};
	if(-1 == readlink(argv[1],buffer,buffer_size))
	{
		printf("fail to delete %s\n",argv[1]);
		return 1;
	}
	write(STDOUT_FILENO,buffer,buffer_size);
	write(STDOUT_FILENO,"\n",1);
	return 0;
}
